import { llRequest } from "."

// 获取项目列表
function getProjectList() {
  return llRequest.get("/project")
}
// 获取单个项目
function getProject(projectId) {
  return llRequest.get(`/project/${projectId}`)
}
// 创建项目
function createProject({name, sourceUrl, onlineUrl, introduce}) {
  return llRequest.post("/project", {
    name,
    sourceUrl,
    onlineUrl,
    introduce
  })
}
// 更新项目
function updateProject(projectId, {name, sourceUrl, onlineUrl, introduce}) {
  return llRequest.patch(`/project/${projectId}`, {
    name,
    sourceUrl,
    onlineUrl,
    introduce
  })
}
// 删除项目
function deleteProject(projectId) {
  return llRequest.delete(`/project/${projectId}`)
}

export {
  getProjectList,
  createProject,
  updateProject,
  deleteProject,
  getProject
}